const ADD_TIMENUM = 'ADD_TIMENUM'
const REMBER_ANSWER = 'REMBER_ANSWER'
const REMBER_TIME = 'REMBER_TIME'
const INITIALIZE_DATA = 'INITIALIZE_DATA'

export default {
  // 点击进入下一题
  [ADD_TIMENUM](state, num) {
    state.itemNum += num;
  },

  // 记录答案
  [REMBER_ANSWER](state, id) {
    state.answerid.push(id);
  },

  [REMBER_TIME](state) {
    state.timer = setInterval(() => {
      state.allTime++;
    }, 1000)
  },

  [INITIALIZE_DATA](state) {
    state.itemNum = 1;
    state.allTime = 0;
    state.answerid = [];
  }
}